From: Wei Liu Date: Fri, 17 Aug 2018 15:12:41 +0000 (+0100) Subject: x86/oprofile: put SVM only code under CONFIG_HVM X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3423 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=1385a14bfc09672513cb5bf9baafa881c8d93542;p=xen.git x86/oprofile: put SVM only code under CONFIG_HVM The code snippet in question is to detect NMI held by SVM until STGI is called. When Xen doesn't even support HVM guests there is no need to check svm_stgi_label. Signed-off-by: Wei Liu Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c index 2d3763cfad..3d6e26f636 100644 --- a/xen/arch/x86/oprofile/op_model_athlon.c +++ b/xen/arch/x86/oprofile/op_model_athlon.c @@ -319,9 +319,11 @@ static int athlon_check_ctrs(unsigned int const cpu, unsigned long eip = regs->rip; int mode = 0; struct vcpu *v = current; - struct cpu_user_regs *guest_regs = guest_cpu_user_regs(); unsigned int const nr_ctrs = model->num_counters; +#if CONFIG_HVM + struct cpu_user_regs *guest_regs = guest_cpu_user_regs(); + if (!guest_mode(regs) && (eip == (unsigned long)svm_stgi_label)) { /* SVM guest was running when NMI occurred */ @@ -329,6 +331,7 @@ static int athlon_check_ctrs(unsigned int const cpu, eip = guest_regs->rip; mode = xenoprofile_get_mode(v, guest_regs); } else +#endif mode = xenoprofile_get_mode(v, regs); for (i = 0 ; i < nr_ctrs; ++i) {